# sample config file for Yafc -*- sh -*-
# If you plan to save passwords in this file,
# make sure permissions is no more than 0600 (chmod 0600 yafcrc)

# blank lines and text between #'s and EOL are skipped
# boolean values can be specified as 1/0, true/false, yes/no, on/off
# strings must be enclosed in quotes ("" or '') if it contains spaces


# You can include any other file using the 'include' statement
#include ~/.yafc/other_preferences

# set password used for anonymous logins
#anon_password "foo@bar.se"

# attempt to login automagically, using login info in bookmarks
autologin on

# attempt to reconnect automatically on timed out connection
autoreconnect on

# quit program if received EOF (C-d)
quit_on_eof yes

# read bookmark entries from ~/.netrc
read_netrc yes

# use passive mode connections
# if false, use sendport mode
# if you get the message "Host doesn't support passive mode", set to false
use_passive_mode yes

# do reverse DNS lookups?
reverse_dns yes

# show some more information (all replies)
verbose off
# print ftp commands sent to server + all replies
debug off
# create trace files
trace off

# If this option is true, filenames will be completed with ... while
# waiting for the directory listing to be downloaded.
waiting_dots on

# Custom options that will be passed to SSH.
# Supports:
#   -l USER; -p PORT; -v; -r; -d; -c CIPHER; -i IDENTITY; -C; -1; -2
#ssh_options "-c blowfish"

# Try to use scp if connect via ssh.
ssh_try_scp yes

# set to true to skip query of remote system on connect
inhibit_startup_syst no

# use environment string to show information
# can be seen in the process list with 'ps'
use_env_string yes

# use tab to complete remote files
remote_completion on

# time (in seconds) before a cached directory times out and needs to
# be reread, 0 == never
cache_timeout 0

# auto-create a bookmark when connection is closed?
auto_bookmark yes # no/yes/ask

# auto-update an existing bookmark when connection is closed?
auto_bookmark_update yes # no/yes/ask

# by default, if auto_bookmark is true, non-anonymous passwords are not saved
# anonymous passwords are always saved though
# if auto_bookmark is 'ask', you will be asked whehter to save password or not
# remember: passwords are stored in clear text!!! (well, base64-encoded...)
auto_bookmark_save_passwd NO

# don't print "created bookmark 'foo', bookmarks saved"
auto_bookmark_silent no

# default type for file transfers
# ascii mode not recommended since it can mess up binary files
# see also 'ascii_transfer_mask' below
default_type binary # ...or ascii

# default security machanisms to use, separated with colon
# valid arguments are krb4, krb5 and none
#default_mechanism "krb4:krb5:none"
#default_mechanism krb4

# filenames matching any of these masks are transferred in ascii mode,
# ignoring the value of 'default_type'
# masks are separated by colons (eg. "*.ext1:*.ext2:filename*:")
# can be overridden with the --type option to get/put
# case sensitive
ascii_transfer_mask "README:*.html:*.htm:*.txt"
ascii_transfer_mask "*.dsc:*.lsm:*.md5"

# filenames matching any of these masks are transferred before other files
transfer_first_mask "*.sfv:*.nfo:*.txt:README*:md5sum*:*.md5:*.diz"

# filenames matching any of these masks are not transferred
ignore_mask ".svn:.git*"

# how many files to transfer to show transfer stats
# you can also specify this per-transfer with --stats=NUM
stats_threshold 20

# beep after a 'long' command is finished
beep_after_long_command yes

# number of seconds for command to become 'long'
long_command_time 30

# how long (in seconds) before aborting a command without response
command_timeout 42
# how long (in seconds) before aborting a connection without response
connection_timeout 30

# number of times to try to re-connect if login failed (due to busy server)
#  -1 for unlimited number of tries, 0 to disable
connect_attempts 10
# number of seconds to wait between connection attempts
connect_wait_time 30

# save and load history lines in ~/.yafc/history
# (this is a no-op if not compiled with readline)
use_history yes

# max number of history lines to save
# (this is a no-op if not compiled with readline)
history_max 256

# Yafc will cd to this (local) directory upon startup
#startup_local_directory ~/download

# if set, Yafc sends mail to this address when nohup transfers are finished
#nohup_mailaddress someusername@somedomain

# complete path to sendmail used by nohup_mailaddress above
#sendmail_path "/usr/sbin/sendmail"

# load saved taglist on connect to same site?
# if no, taglist will never be saved
load_taglist yes # yes/no/ask

# display ~ instead of full home directory path for various commands
tilde yes

# aliases (on the form [alias name value])
# can't make an alias of another alias

alias dir "ls -lF"
alias ls "ls -F"
alias rels "cache --touch %*; ls -F %*"
alias pls "ls -F %* |$PAGER"
alias bye quit
alias ? "help"
alias binary "set type binary"
alias ascii "set type ascii"
alias get "get --verbose --preserve"
alias put "put --verbose"
alias rm "rm --verbose"
alias lrm "shell rm"
alias lls "shell ls -F"
alias lmkdir "shell mkdir"
alias lrmdir "shell rmdir"
alias lcat "!cat"
alias zcat "cat --type=binary %* | zcat"
alias bzcat "cat --type=binary %* | bzcat"
alias page "cat --type=ascii %* | $PAGER"
alias zpage "cat --type=binary %* | zcat | $PAGER"
alias bzpage "cat --type=binary %* | bzcat | $PAGER"
alias show_trace "!$PAGER $HOME/.yafc/trace/trace.$PPID"

# Change both local and remote directory at the same time
alias xcd "cd %*; lcd %*"

# Diff a local file against a remote file
alias xdiff "get -qf %1 -o /tmp/yafc-diff; shell diff -u /tmp/yafc-diff %1; shell rm /tmp/yafc-diff"

# ftp prompts
#
# special codes:
# %u      username
# %h      remote host name (as passed to open)
# %H      %h up to the first '.'
# %m      remote machine name (as returned by gethostbyname)
# %M      %m up to the first '.'
# %n      remote ip number
# %[#]w   current remote working directory
# %W      basename of %w
# %[#]~   as %w but home directory is replaced with ~
# %[#]l   current local working directory
# %%      percent sign
# %#      a '#' if (local) user is root, else '$'
# %c      number of open connections
# %C      current connection number
# %{      begin sequence of non-printing chars, ie escape codes
# %}      end      -"-
# \e      escape (0x1B)
# \n      newline
# \t      tab
# \r      carriage return
# \b      backspace
# \x##    character 0x## (hex)
#
# [#] means an optional width specifier can be specified
#  example: %32w
#
# you can put escape codes here, for example if you want a colored prompt
#  "%{\e[01;31m%}ftp%{\e[0m%}" will be "ftp" in red, if your terminal supports
#  ISO 6429 (ANSI) color codes.
#
# note: the %{ and %} codes are needed for readline to correctly wrap
#  lines with embedded escape codes
#
# (ANSI) Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white

prompt1 "yafc> "                    # not connected
prompt2 "yafc %h> "                 # connected but not logged in
prompt3 "yafc %u@%h:%42~> "         # connected and logged in

# Xterm window titles
# same codes as for the prompts above
# see the Xterm-title mini-HOWTO for more information
xterm_title1 "\e]0;yafc\x07"            # not connected
xterm_title2 "\e]0;yafc %h\x07"         # connected but not logged in
xterm_title3 "\e]0;yafc %u@%h:%~\x07"   # connected and logged in

# $TERM's which can handle xterm escape sequences
xterm_title_terms "xterm xterm-debian rxvt"

# transfer status string codes
# these strings are printed with the --verbose option to get/put
# 
# %r   - remote filename         (actually _source_ filename)
# %R   - remote filename w/path  (actually _source_ filename)
# %l   - local filename          (actually _target_ filename)
# %L   - local filename w/path   (actually _target_ filename)
# %s   - size transferred so far
# %S   - total size (if available)
# %e   - ETA (time left)
# %p   - percent transferred
# %%   - percent sign
# %b   - transfer rate (Bps)
# %B   - transfer rate (Bps) or "stalled" if stalled
# %t   - time elapsed
# %v   - visual progress bar
# %{   - begin sequence of non-printing chars, ie escape codes
# %}   - end sequence of non-printing chars
#
# you can specify an (optional) max width between the '%' and
# the character code
# escape codes are recognized (enclose in %{ and %} pairs)

# this string is printed before the actual transfer begins
#transfer_begin_string "%{\e[32m%}%-70R%{\e[0m%}\n"
transfer_begin_string "%-70R\n"

# this string is printed (approx.) every second or so during the transfer
# with a trailing carriage return
#transfer_string "%-38R   [%25v] %B"
#transfer_string "%-35R   %s of %S ETA %e %B"
#transfer_string "%5p%% [%{\e[32m%}%25v%{\e[0m%}] %s/%S ETA %{\e[32m%}%e%{\e[0m%} %B"
transfer_string "%5p%% [%25v] %s/%S ETA %e %B"

# this string is printed when the transfer is finished
#transfer_end_string "%-35R   %p%% of %S in %t (%b)\n"
transfer_end_string ""

# this string is printed at the same time as transfer_string if current
# $TERM is defined in xterm_title_terms
# Use to show dynamic info in the xterm title bar
transfer_xterm_string "\e]0;%p%% - %R - yafc\x07"


#
# Proxy settings
#

# proxy_type is the type of proxy, valid arguments:
#
# 0 - no proxy (default)
# 1 - connect to proxy, USER real_user@real_host, PASS real_password
# 2 - login to proxy, USER real_user@real_host, PASS real_password
# 3 - login to proxy, SITE real_host, USER real_user, PASS real_password
# 4 - login to proxy, OPEN real_host, USER real_user, PASS real_password
# 5 - connect to proxy, USER real_user@proxy_user@real_host, PASS real_password@proxy_password
# 6 - connect to proxy, USER proxy_user@real_host, PASS proxy_password, USER realuser, PASS real_password
# 7 - connect to proxy, USER real_user@real_host:real_port, PASS real_password

proxy_type 0

# the proxy host to connect to including
# username, password and port (all optional)
# if username or password not given, you will
# be prompted for it
#proxy_host user:pass@host:port
# examples:
# connect to proxy host at port 21, prompt for username and password:
#proxy_host host
# connect to proxy host at port 4711, use username nisse and prompt for password:
#proxy_host nisse@host:4711

# list of hosts to exclude from proxying (separated with colon)
# 'localnet' specifies unqualified hosts (within your domain)
proxy_exclude localhost:localnet

# end of configuration file
